#include <iostream>
#include <stack>
#include <cmath>
#include <algorithm>
#include <vector>

using namespace std;


int main() {

    int arr[5] = {1, 2, 3, 4, 5};
    binary_search(arr, arr+5, -2);

    vector<int> v;
    v.push_back(1);
    v.push_back(2);
    v.push_back(3);
    bool f = binary_search(v.begin(), v.end(), 3);
    

    // counting elements in array:
    int myints[] = {10,20,30,30,20,10,10,20}; 
    int mycount = std::count (myints, myints+8, 10);
    int mycount2 = std::count (v.begin(), v.end(), 3);
    std::cout << "10 appears " << mycount << " times.\n";
    std::cout << "3 appears " << mycount2 << " times.\n";

    return 0;
}